using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for UserAcc
/// </summary>
public class UserAcc
{
    #region Fields
    string _userID;
    string _pwd; //encryptedPwd
    string _fullName;
    DateTime _dateOfBirth;
    string _address;
    string _idCard;
    string _email;
    string _activationCode;
    bool _activated;
    string _cardType;
    string _cardOwner;
    byte[] _cardNo;
    DateTime _expiredDate;
    bool _disabled; 
    #endregion

    #region Properties
    public string UserID
    {
        get { return _userID; }
        set { _userID = value; }
    }

    public string PWD
    {
        get { return _pwd; }
        set { _pwd = value; }
    }

    public string FullName
    {
        get { return _fullName; }
        set { _fullName = value; }
    }

    public DateTime DateOfBirth
    {
        get { return _dateOfBirth; }
        set { _dateOfBirth = value; }
    }

    public string Address
    {
        get { return _address; }
        set { _address = value; }
    }

    public string IdCard
    {
        get { return _idCard; }
        set { _idCard = value; }
    }

    public string Email
    {
        get { return _email; }
        set { _email = value; }
    }

    public string ActivationCode
    {
        get { return _activationCode; }
        set { _activationCode = value; }
    }

    public bool Activated
    {
        get { return _activated; }
        set { _activated = value; }
    }

    public string CardType
    {
        get { return _cardType; }
        set { _cardType = value; }
    }

    public string CardOwner
    {
        get { return _cardOwner; }
        set { _cardOwner = value; }
    }

    public byte[] CardNo
    {
        get { return _cardNo; }
        set { _cardNo = value; }
    }

    public DateTime ExpiredDate
    {
        get { return _expiredDate; }
        set { _expiredDate = value; }
    }

    public bool Disabled
    {
        get { return _disabled; }
        set { _disabled = value; }
    }
    #endregion

    public UserAcc() { }

    /// <summary>
    /// FULL constructor
    /// </summary>
    public UserAcc(string userID, string pwd, string fullName, DateTime dateOfBirth,
        string address, string idCard, string email, string activationCode, bool activated,
        string cardType, string cardOwner, byte[] cardNo, DateTime expiredDate, bool disabled)
    {
        _userID = userID;
        _pwd = pwd;
        _fullName = fullName;
        _dateOfBirth = dateOfBirth;
        _address = address;
        _idCard = idCard;
        _email = email;
        _activationCode = activationCode;
        _activated = activated;
        _cardType = cardType;
        _cardOwner = cardOwner;
        _cardNo = cardNo;
        _expiredDate = expiredDate;
        _disabled = disabled;
    }

    /// <summary>
    /// Duplicate
    /// </summary>
    public UserAcc(UserAcc dto)
    {
        _userID = dto.UserID;
        _pwd = dto.PWD;
        _fullName = dto.FullName;
        _dateOfBirth = dto.DateOfBirth;
        _address = dto.Address;
        _idCard = dto.IdCard;
        _email = dto.Email;
        _activationCode = dto.ActivationCode;
        _activated = dto.Activated;
        _cardType = dto.CardType;
        _cardOwner = dto.CardOwner;
        _cardNo = dto.CardNo;
        _expiredDate = dto.ExpiredDate;
        _disabled = dto.Disabled;
    }

    /// <summary>
    /// Constructor use for editing in admin mode
    /// </summary>
    public UserAcc(string userID, string fullName, DateTime dateOfBirth, string address, string email, bool disabled)
    {
        _userID = userID;
        _pwd = "";
        _fullName = fullName;
        _dateOfBirth = dateOfBirth;
        _address = address;
        _idCard = "";
        _email = email;
        _activationCode = "";
        _activated = false;
        _cardType = "";
        _cardOwner = "";
        _cardNo = null;
        _expiredDate = DateTime.Today;
        _disabled = disabled;
    }
}
